<%@include file="/WEB-INF/pages/commons/commons.jsp" %>

<stripes:layout-render name="${_themePath}/basic-layout-without-navbar.jsp" _title="Add Page">

    <stripes:layout-component name="_topNav">
        <H1>Add Page</H1>
        <UL class="gc-topnav-tabs">
            <LI>&nbsp;</LI>
        </UL>
    </stripes:layout-component>


    <stripes:layout-component name="_content">

        <stripes:messages/>
        <p/>
        <p/>

        <h2>Description [<a id="showDescription" href="">Show</a>/<a id="hideDescription" href="">Hide</a>]</h2>
        <div id="description">
            This is where you'd add a new Page to the existing Space (${actionBean.page.space.name}). The space
            cannot be changed, you'll need to navigate to the other space where you'd like to add the page if
            this is not the desired space to be added. You can't put wiki content at this page during it's
            creation. After it's being created just navigate to that page and add the wiki content then.
            <p/>
            <ul>
                <li>Name - The name of the page, mandatory, it can contains only alphanumeric and '_' character</li>
                <li>Description - A description of this page</li>
                <li>Space - The Space name this page belongs to</li>
                <li>Theme - The theme this page will used (inherited from the Space's theme)</li>
                <li>Location - The location of the page template. You'd normally don't want to change this
                unless you know what's going on.</li>
            </ul>
            <p/>
            <p/>
            <p/>
        </div>



        <h2>Page Details</h2>
        <jsecurity:hasPermission name="space:addPage:${actionBean.page.space.id}">
        <stripes:form beanclass="foo.bar.wiki.web.action.page.AddPageActionBean" method="POST">
        <stripes:errors/>
        <input type="hidden" name="page" value=""/>
        <input type="hidden" name="page.space" value="${actionBean.page.space.id}"/>
        <table width="100%">
            <tr>
                <td>Name: </td>
                <td><stripes:text name="page.name"/></td>
            </tr>
            <tr>
                <td>Description:</td>
                <td><stripes:text name="page.description"/></td>
            </tr>
            <tr>
                <td>Space: </td>
                <td>${actionBean.page.space.name}</td>
            </tr>
            <tr>
                <td>Theme: </td>
                <td>${actionBean.page.space.themeName}</td>
            </tr>
            <tr>
                <td>Location: </td>
                <td><stripes:text name="page.pageLocation"/></td>
            </tr>
            <tr><td colspan="2"><stripes:submit name="save">Save</stripes:submit></td></tr>
        </table>
        </stripes:form>
        </jsecurity:hasPermission>
        <jsecurity:lacksPermission name="space:addPage:${actionBean.page.space.id}">
            Lacks "space:addPage:${actionBean.page.space.id}" permission    
        </jsecurity:lacksPermission>


    </stripes:layout-component>
</stripes:layout-render>



